/*!
 * PhotoSphereViewer.SettingsPlugin 5.4.4
 * @copyright 2023 Damien "Mistic" Sorel
 * @licence MIT (https://opensource.org/licenses/MIT)
 */

@use 'sass:list';
// *** MAIN ***
$psv-main-background-stops: #fff 0%,
    #fdfdfd 16%,
    #fbfbfb 33%,
    #f8f8f8 49%,
    #efefef 66%,
    #dfdfdf 82%,
    #bfbfbf 100% !default;
$psv-main-background: radial-gradient($psv-main-background-stops) !default;
$psv-element-focus-outline: 2px solid #007cff !default;

// *** LOADER ***
$psv-loader-bg-color: rgba(61, 61, 61, 0.5) !default;
$psv-loader-color: rgba(255, 255, 255, 0.7) !default;
$psv-loader-width: 150px !default;
$psv-loader-tickness: 10px !default;
$psv-loader-border: 3px !default;
$psv-loader-font: 600 16px sans-serif !default;

// *** NAVBAR ***
$psv-navbar-height: 40px !default;
$psv-navbar-background: rgba(61, 61, 61, 0.5) !default;

$psv-caption-font: 16px sans-serif !default;
$psv-caption-text-color: rgba(255, 255, 255, 0.7) !default;

$psv-buttons-height: 20px !default;
$psv-buttons-padding: (($psv-navbar-height - $psv-buttons-height) * 0.5) !default;
$psv-buttons-background: transparent !default;
$psv-buttons-active-background: rgba(255, 255, 255, 0.2) !default;
$psv-buttons-color: rgba(255, 255, 255, 0.7) !default;
$psv-buttons-disabled-opacity: 0.5 !default;

$psv-buttons-hover-scale: 1.2 !default;
$psv-buttons-hover-scale-delay: 200ms !default;

$psv-zoom-range-width: 80px !default;
$psv-zoom-range-tickness: 1px !default;
$psv-zoom-range-diameter: 7px !default;
$psv-zoom-range-media-min-width: 600px !default;

// *** TOOLTIP ***
$psv-tooltip-background: rgba(61, 61, 61, 0.8) !default;
$psv-tooltip-animate-offset: 5px !default;
$psv-tooltip-animate-delay: 100ms !default;
$psv-tooltip-radius: 4px !default;
$psv-tooltip-padding: 0.5em 1em !default;
$psv-tooltip-arrow-size: 7px !default;
$psv-tooltip-max-width: 200px !default;

$psv-tooltip-text-color: rgb(255, 255, 255) !default;
$psv-tooltip-font: 14px sans-serif !default;
$psv-tooltip-text-shadow: 0 1px #000 !default;

$psv-tooltip-shadow-color: rgba(90, 90, 90, 0.7) !default;
$psv-tooltip-shadow-offset: 3px !default; // the shadow is always at the opposite side of the arrow

// *** PANEL ***
$psv-panel-background: rgba(10, 10, 10, 0.7) !default;
$psv-panel-text-color: rgb(220, 220, 220) !default;
$psv-panel-font: 16px sans-serif !default;
$psv-panel-width: 400px !default;
$psv-panel-padding: 1em !default;
$psv-panel-animate-delay: 100ms !default;

$psv-panel-resizer-width: 9px !default; // must be odd
$psv-panel-resizer-background: rgba(0, 0, 0, 0.9) !default;
$psv-panel-resizer-grip-color: #fff !default;
$psv-panel-resizer-grip-height: 29px !default; // must be odd
$psv-panel-close-button-size: 32px !default;
$psv-panel-close-button-background: $psv-panel-resizer-background !default;
$psv-panel-close-button-color: #fff !default;
$psv-panel-close-button-animate-delay: 300ms !default;

$psv-panel-title-font: 24px sans-serif !default;
$psv-panel-title-icon-size: 24px !default;
$psv-panel-title-margin: 24px !default;

$psv-panel-menu-item-height: 1.5em !default;
$psv-panel-menu-item-padding: 0.5em 1em !default;
$psv-panel-menu-item-active-outline: 1px !default;
$psv-panel-menu-odd-background: rgba(255, 255, 255, 0.1) !default;
$psv-panel-menu-even-background: transparent !default;
$psv-panel-menu-hover-background: rgba(255, 255, 255, 0.2) !default;

// *** NOTIFICATION ***
$psv-notification-position-from: -$psv-navbar-height !default;
$psv-notification-position-to: $psv-navbar-height * 2 !default;
$psv-notification-animate-delay: 200ms !default;
$psv-notification-background: $psv-tooltip-background !default;
$psv-notification-radius: $psv-tooltip-radius !default;
$psv-notification-padding: $psv-tooltip-padding !default;
$psv-notification-font: $psv-tooltip-font !default;
$psv-notification-text-color: $psv-tooltip-text-color !default;

// *** OVERLAY ***
$psv-overlay-opacity: 0.8 !default;
$psv-overlay-title-font: 30px sans-serif !default;
$psv-overlay-title-color: black !default;
$psv-overlay-text-font: 20px sans-serif !default;
$psv-overlay-text-color: rgba(0, 0, 0, 0.8) !default;
$psv-overlay-image-size: (
    portrait: 50vw,
    landscape: 25vw,
) !default;

// *** Z-INDEXES ***
$psv-canvas-zindex: 0 !default;
$psv-hud-zindex: 10 !default;
$psv-polygon-marker-zindex: 20 !default;
$psv-marker-zindex: 30 !default;
$psv-compass-zindex: 40 !default;
$psv-tooltip-zindex: 50 !default;
$psv-loader-zindex: 80 !default;
$psv-panel-zindex: 90 !default;
$psv-navbar-zindex: 90 !default;
$psv-notification-zindex: 100 !default;
$psv-overlay-zindex: 110 !default;


$psv-settings-margin: 10px !default;
$psv-settings-font: $psv-caption-font !default;
$psv-settings-item-height: $psv-panel-menu-item-height !default;
$psv-settings-item-padding: $psv-panel-menu-item-padding !default;
$psv-settings-background: $psv-panel-background !default;
$psv-settings-shadow: 0 0 5px $psv-settings-background !default;
$psv-settings-text-color: $psv-panel-text-color !default;
$psv-settings-hover-background: $psv-panel-menu-hover-background !default;
$psv-settings-badge-font: 10px / 0.9 monospace !default;
$psv-settings-badge-background: #111 !default;
$psv-settings-badge-text-color: white !default;

.psv-container {
    --psv-settings-plugin-loaded: true;
}

.psv-settings {
    position: absolute;
    bottom: $psv-navbar-height;
    background: $psv-settings-background;
    box-shadow: $psv-settings-shadow;
    font: $psv-settings-font;
    color: $psv-settings-text-color;
    z-index: $psv-navbar-zindex;
    opacity: 0;
    transition: opacity 0.1s linear;
    margin: $psv-settings-margin;

    &--open {
        opacity: 1;
    }

    &-list {
        list-style: none;
        margin: 0;
        padding: 0;
    }
}

.psv-settings-item {
    height: $psv-settings-item-height;
    padding: $psv-settings-item-padding;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    cursor: pointer;

    &:hover {
        background: $psv-settings-hover-background;
    }

    &:focus-visible {
        outline: $psv-element-focus-outline;
        outline-offset: -#{list.nth($psv-element-focus-outline, 1)};
    }

    *:not(:last-child) {
        margin-right: 1em;
    }

    &-label {
        flex: 1;
        font-weight: bold;
    }

    &-value {
        flex: none;
    }

    &-icon {
        flex: none;
        height: 1em;
        width: 1em;

        svg {
            width: 100%;
            height: 100%;
            vertical-align: initial;
        }
    }

    &--header {
        border-bottom: 1px solid currentcolor;

        svg {
            transform: scaleX(-1);
        }
    }
}

.psv-settings-badge {
    position: absolute;
    top: 10%;
    right: 10%;
    border-radius: 0.2em;
    padding: 0.2em;
    background: $psv-settings-badge-background;
    color: $psv-settings-badge-text-color;
    font: $psv-settings-badge-font;
}
